<?php

/**
 * Teacher form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseTeacherForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'country_id'           => new sfWidgetFormPropelChoice(array('model' => 'Country', 'add_empty' => false)),
      'degree_id'            => new sfWidgetFormPropelChoice(array('model' => 'Degree', 'add_empty' => false)),
      'teacher_account_name' => new sfWidgetFormInput(),
      'teacher_password'     => new sfWidgetFormInput(),
      'teacher_first_name'   => new sfWidgetFormInput(),
      'teacher_last_name'    => new sfWidgetFormInput(),
      'birthday'             => new sfWidgetFormDate(),
      'teacher_about_me'     => new sfWidgetFormTextarea(),
      'teacher_education'    => new sfWidgetFormTextarea(),
      'teacher_experience'   => new sfWidgetFormTextarea(),
      'teacher_addresss'     => new sfWidgetFormInput(),
      'teacher_phone'        => new sfWidgetFormInput(),
      'teacher_email'        => new sfWidgetFormInput(),
      'teacher_avatar_img'   => new sfWidgetFormInput(),
      'teacher_last_visit'   => new sfWidgetFormDateTime(),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorPropelChoice(array('model' => 'Teacher', 'column' => 'id', 'required' => false)),
      'country_id'           => new sfValidatorPropelChoice(array('model' => 'Country', 'column' => 'iso')),
      'degree_id'            => new sfValidatorPropelChoice(array('model' => 'Degree', 'column' => 'id')),
      'teacher_account_name' => new sfValidatorString(array('max_length' => 45)),
      'teacher_password'     => new sfValidatorString(array('max_length' => 50)),
      'teacher_first_name'   => new sfValidatorString(array('max_length' => 45)),
      'teacher_last_name'    => new sfValidatorString(array('max_length' => 45)),
      'birthday'             => new sfValidatorDate(array('required' => false)),
      'teacher_about_me'     => new sfValidatorString(),
      'teacher_education'    => new sfValidatorString(),
      'teacher_experience'   => new sfValidatorString(),
      'teacher_addresss'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'teacher_phone'        => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'teacher_email'        => new sfValidatorString(array('max_length' => 255)),
      'teacher_avatar_img'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'teacher_last_visit'   => new sfValidatorDateTime(),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'updated_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('teacher[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Teacher';
  }


}
